<?php

namespace app\common\validate;

class GoodsCategoryValidate extends BaseValidate
{
    /**
     * 验证规则
     */
    protected $field = [
        'id'            => 'ID',
        'category_name' => '分类名称',

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'index'  => [
            'keyword',
            'page_index',
            'page_size'
        ],
        'save'   => [
            'category_name' => 'require|unique:goods_category',
            'image'         => 'require',
        ],
        'update' => [
            'id'            => 'require',
            'category_name' => 'unique:goods_category',
            'image'         => 'require'
        ],
    ];

    /**
     * 提示消息
     */
    protected $message = [

    ];


}
